#include <iostream>
#include <vector>

using namespace std;

int main() {
    int n;
    cin >> n;
    vector<vector<int>> vt(n, vector<int>(n));
    vt[0][0] = 1;
    if (n == 1)
        printf("%5d", 1);
    else {
        for (int i = 1; i < n; ++i) {
            vt[i][0] = 1;
            for (int j = 0; j < i + 1; ++j)
                vt[i][j] = vt[i - 1][j - 1] + vt[i - 1][j];
        }
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < i + 1; j++) {
                printf("%5d", vt[i][j]);
            }
            cout << endl;
        }
    }
    return 0;
}